package com.sl.au.repository;


import com.sl.au.entity.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface TaskRepository extends JpaRepository<Task, String> {
	
//////首页待处理信息获取数据//////
  @Query( "select t from Task t where transactorId=?1 or transactorId=?2")
	Page<Task> getMyTask(String userId,String roleId,Pageable pageable);
	
  @Query( "select count(*) from Task t where transactorId=?1 or transactorId=?2")
	long getTaskCount(String userId,String roleId);
  
  Task findByUndoTaskIdAndName(String taskId,String name);
  
	
	@Query("select r from Role r where r.name=?1")
	Role findByName(String rolename);
	
	
	
}
